package com.example;
import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;
import static org.mockito.Mockito.*;

public class HeartTest {
	Heart testObject;
	 private static final double DELTA = 1e-15; 
	  @Before
     public void setUp() throws Exception {
		  testObject = new Heart();
     }

	@Test
	public void testCalcArea() {
		testObject.radio = 5;
		testObject.height = 10;		
		
		Circle mockedCircle = mock(Circle.class);   
		Triangle mockedTriangle = mock(Triangle.class);   
		 
		when(mockedCircle.calcArea()).thenReturn(Math.PI * 25);
		when(mockedTriangle.calcArea()).thenReturn((double) 100);
		
		testObject.up = mockedCircle;
		testObject.down = mockedTriangle;
		
		double expArea = Math.PI * 25 + 100;
		double area = testObject.calcArea();

		assertEquals(expArea, area,  DELTA); 
	}

	@Test
	public void testCalcGrith() {
		//fail("Not yet implemented");
	}

}
